import type { Api_Response_Dto } from '@/dto/response/Api_Response_Dto';
import request from '@/utils/request'


/**
 * 获取等级配置
 * @param obj
 * @returns
 */
export const Get_Level = ():
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/CustomerVip/Get_Level",
        method: "get",
    });
}

/**
 * 获取会员
 * @param obj
 * @returns
 */
export const Get_vip = ():
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/CustomerVip/Get_vip",
        method: "get",
    });
}

/**
 * 获取会员
 * @param obj
 * @returns
 */
export const Get_vip_single = (obj:{id:string}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/CustomerVip/Get_vip_single",
        method: "get",
        params:obj
    });
}
/**
 * 获取会员
 * @param obj
 * @returns
 */
export const Get_vip_Order = (obj:{id:string}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/CustomerVip/Get_vip_Order",
        method: "get",
        params:obj
    });
}
/**
 * 获取会员
 * @param obj
 * @returns
 */
export const Get_vip_Tolist = ():
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/CustomerVip/Get_vip_Tolist",
        method: "get",
    });
}

/**
 * 获取会员
 * @param obj
 * @returns
 */
export const Get_Origin = ():
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/Customer/Get_Origin",
        method: "get",
    });
}
/**
 * 获取会员
 * @param obj
 * @returns
 */
export const update_vip = (obj:{id:string,name:string,explain:string,discount:number}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/CustomerVip/update_vip",
        method: "post",
        data:obj
    });
}
/**
 * 获取会员
 * @param obj
 * @returns
 */
export const Vip_Consumption = ():
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/CustomerVip/Vip_Consumption",
        method: "get",
    });
}
/**
 * 新增会员
 * @param obj
 * @returns
 */
export const add_vip = (obj:{name:string,rechargeAmount:number,lv:string,responsible:string,address:string,phone:string}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/CustomerVip/Add_vip",
        method: "post",
        data:obj
    });
}
/**
 * 删除会员
 * @param obj
 * @returns
 */
export const del_vip = (obj:{id:string}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/CustomerVip/Del_vip",
        method: "post",
        params:obj
    });
}
/**
 * 给会员充值
 * @param obj
 * @returns
 */
export const rechargeVip = (obj:{id:string,money:number,desc?:string}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/CustomerVip/Recharge_vip",
        method: "post",
        params:obj
    });
}
